window.onload = function(){
        var number=document.getElementById("number");
        number.value=sessionStorage.getItem("number1");
        var password = document.getElementById("password");
        var login = document.getElementById("login");
        var register = document.getElementById("register");
        register.onclick = function(){
            window.location.href="register.html";
        }
        login.onclick=function () {
            var data={
                number:number.value,
                password:password.value
            }
            $.ajax({
                type:"post",
                dataType:"text",
                url:"/fp_war_exploded/login",
                data:JSON.stringify(data),
                success:function (result) {
                    if(result.match("success")){
                        alert("登录成功");
                        window.location.href="index.html";
                        sessionStorage.setItem("number",number.value);
                    }
                },
                error:function () {
                    alert("error");
                }
            });
        }
    }